export default {
  debounce(fn, wait = 500) {
    var timer = null
    return function() {
      var context = this
      var args = arguments
      console.log(args)
      if (timer) {
        clearTimeout(timer)
        timer = null
      }
      timer = setTimeout(function() {
        fn.apply(context, args)
      }, 500)
    }
  }
}
